package com.med.preheat;

import com.med.service.DepartmentService;
import com.med.service.ScheduleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

/**
 * @BelongsProject: Internet-based-healthcare
 * @BelongsPackage: com.med.preheat
 * @Author: 小龚
 * @CreateTime: 2025-08-22 13:53
 * @Description: 预热
 * @Version: 1.0
 */
@Component
public class StartupPreLoader implements ApplicationRunner {

    private final DepartmentService departmentService;


    private final ScheduleService scheduleService;


    @Autowired
    public StartupPreLoader(DepartmentService departmentService, ScheduleService scheduleService) {
        this.departmentService = departmentService;
        this.scheduleService = scheduleService;
    }


    @Override
    public void run(ApplicationArguments args) throws Exception {
        departmentService.getDepartmentByPreheat();
        scheduleService.checkScheduleForDoctor();
        scheduleService.generateReservationNumber();
        scheduleService.generateNotice();
//        scheduleService.initialScheduleDoctorsWeekly(doctorId);
    }
}
